﻿<UserControl x:Class="VisualRibbonEditor.ViewXmlDialog"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit"
	mc:Ignorable="d" 
	d:DesignHeight="250" d:DesignWidth="500" FontSize="12" KeyUp="ViewXmlDialog_KeyUp" FocusManager.IsFocusScope="True">

	<Border BorderThickness="2" BorderBrush="Black">
		<Grid x:Name="LayoutRoot" Background="#fcfcfc" 
			  Width="{Binding ActualWidth,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" 
			  Height="{Binding ActualHeight,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}">
			<Grid.RowDefinitions>
				<RowDefinition Height="*" />
				<RowDefinition Height="40" />
			</Grid.RowDefinitions>

			<StackPanel Grid.Row="0">
				<Border Background="#eeeeee" BorderThickness="0,0,0,1" BorderBrush="#aaaaaa">
					<TextBlock Text="View RibbonDiffXml (read only)" FontSize="14" Margin="5" HorizontalAlignment="Left" />
				</Border>
			</StackPanel>
			<avalonedit:TextEditor Grid.Row="0"
				SyntaxHighlighting="XML"
				ShowLineNumbers="True" 
				Margin="5,35,5,5"
				Name="XmlBox"
				FontFamily="Courier New"
				FontSize="14" 
				IsReadOnly="True"
				VerticalScrollBarVisibility="Visible" 
				HorizontalScrollBarVisibility="Auto"
				ContextMenuOpening="ContextMenu_ContextMenuOpening">
				<avalonedit:TextEditor.ContextMenu>
					<ContextMenu>
						<MenuItem Header="Copy" Name="MenuItem_Copy" IsEnabled="False" Command="ApplicationCommands.Copy" />
						<MenuItem Header="Select all" IsEnabled="True" Command="ApplicationCommands.SelectAll" />
					</ContextMenu>
				</avalonedit:TextEditor.ContextMenu>
			</avalonedit:TextEditor>
			<Border Grid.Row="1" BorderThickness="0,1,0,0" BorderBrush="#aaaaaa">
				<DockPanel>
					<CheckBox Name="WordWrap" Content="Word Wrap" Checked="WordWrap_OnChange" Unchecked="WordWrap_OnChange" IsChecked="False" Margin="5,10,5,5" HorizontalAlignment="Left" VerticalAlignment="Center"/>
						<Button Name="OKButton" Content="Close" Height="22" MinWidth="65" Margin="10,0,10,0" Click="OKButton_Click" HorizontalAlignment="Right" />
				</DockPanel>
			</Border>
		</Grid>
	</Border>
</UserControl>